package com.dmjj.cadcommon.result;

import com.alibaba.fastjson.JSON;
import com.dmjj.cadcommon.vo.ResultVO;
import org.springframework.stereotype.Component;

/**
 * @author 王丽凯
 * @Description: 统一返回格式
 * @Title: ResultObject
 * @ProjectName dmjj-parent
 * @date 2018/12/24
 */
@Component
public class ResultObject {


    public ResultVO success(Integer code, String msg){
        ResultVO resultVO = new ResultVO(code,msg,null);
        return resultVO;
    }

    public ResultVO success(Integer code, String msg, Object object){
        ResultVO resultVO = new ResultVO(code,msg,object);
        return resultVO;
    }


    public ResultVO success(Integer code, String msg, JSON json){
        ResultVO resultVO = new ResultVO(code,msg,json);
        return resultVO;
    }

    public ResultVO error(Integer code, String msg){
        ResultVO resultVO = new ResultVO(code,msg,null);
        return resultVO;
    }


}
